package com.shenzhenai.it_hei_ma.a09threadsafe1;

/**
 * @author huangzehui
 * @date 2025/8/27 13:41 周三
 * @description
 *
 * 多线程&JUC-12-线程的安全问题
 * https://www.bilibili.com/video/BV1LG4y1T7n2?spm_id_from=333.788.videopod.episodes&vd_source=e07cc8cc94eb22bd76722071b03cd199&p=12
 *
 *
 * 多线程&JUC-13-同步代码块
 * https://www.bilibili.com/video/BV1LG4y1T7n2?spm_id_from=333.788.player.switch&vd_source=e07cc8cc94eb22bd76722071b03cd199&p=13
 *
 * 多线程&JUC-14-同步代码块的两个小细节
 * https://www.bilibili.com/video/BV1LG4y1T7n2?spm_id_from=333.788.videopod.episodes&vd_source=e07cc8cc94eb22bd76722071b03cd199&p=14
 *
 * 多线程&JUC-15-同步方法
 * https://www.bilibili.com/video/BV1LG4y1T7n2?spm_id_from=333.788.videopod.episodes&vd_source=e07cc8cc94eb22bd76722071b03cd199&p=15
 *
 */
public class ThreadDemo {

    public static void main(String[] args) {
        /*
        需求:
            某电影院目前正在上映国产大片，共有100张票，而它有3个窗口卖票，请设计一个程序模拟该电影院卖票
         */

        MyThread t1 = new MyThread();
        MyThread t2 = new MyThread();
        MyThread t3 = new MyThread();

        t1.setName("窗口1");
        t2.setName("窗口2");
        t3.setName("窗口3");

        t1.start();
        t2.start();
        t3.start();
    }
}
